import { BrnSelectGroup } from '@spartan-ng/brain/select';
import { Directive, computed, input } from '@angular/core';
import { hlm } from '@spartan-ng/helm/utils';

import type { ClassValue } from 'clsx';

@Directive({
  selector: '[hlmSelectGroup], hlm-select-group',
  hostDirectives: [BrnSelectGroup],
  host: {
    '[class]': '_computedClass()',
  },
})
export class HlmSelectGroup {
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
  protected readonly _computedClass = computed(() => hlm(this.userClass()));
}
